package ro.myApp.commons.service;

import java.util.List;

import org.hibernate.criterion.Criterion;

import ro.myApp.commons.basic.PersistentEntity;

public interface EntityAccessService<E extends PersistentEntity> {

	E findById(Long id);

	E findUniqueFiltered(Criterion...criteria);

	
	List<E> findFiltered (Criterion...criteria);
	
	int countFiltered (Criterion...criteria);
	
	List<E> findAll();
	
	List<E> findAll(int maxResults);

	List<E> findFiltered(int maxResults, Criterion[] criteria);
	
	List<E> findFiltered(String orderBy, boolean direction, int maxResults,
			Criterion[] criteria);
}